<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%@ page import="com.scalar.chiptrack.commons.Constants" %>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>


<chiptrack:checkLogon sourcePage="/lotCorrection.do"/>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>
<HTML>
    <HEAD>
        <TITLE>Scalarsoft - ChipTrac</TITLE>
        <LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet">
        <script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
        <script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
        <script type="text/javascript">
            function loadProducts()
            {
                var form = document.lotCorrectionsForm;
                if( form.processType.value != '0' )
                {
                    form.action.value="load_partNumbers";
                    form.submit();
                }
            }
            function loadLocations()
            {
                var form = document.lotCorrectionsForm;
                if( form.processStepId.value != '0' )
                {
                    form.action.value="load_locations";
                    form.submit();
                }
            }
            function loadLotNumbers()
            {
                var form = document.lotCorrectionsForm;
                if( form.locationId.value != '0' )
                {
                    form.action.value="load_lotNumbers";
                    form.submit();
                }
            }
            function loadLot()
            {
                var form = document.lotCorrectionsForm;
                if( form.lotId.value != '0' )
                {
                   form.action.value="load_lotDetails";
                   form.submit();
                }
            }
            var dateElement = "";
            function openCalendar(dateValue)
            {
                dateElement = dateValue;
                newWindow = window.open('<%=chipTracContext%>/jsp/includes/calendar.html','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=180,height=440,resizable=no');
                newWindow.moveTo(550,180);
                newWindow.focus();
            }
            function assignDate(passedValue)
            {
                dateElement.value=passedValue;
                window.focus();
            }
            function isValidInteger(temp)
            {
                errors = "";
                var pa=document.getElementById("message");

                if(!isInteger(temp.value))
                {
                    errors = "<li>Please enter a valid integer</li>";
                    pa.innerHTML = errors;
                    temp.focus();
                    return false;
                }
                return true;
            }
            function save()
            {
                finalSave();
            }

            function finalSave()
            {
                var form = document.lotCorrectionsForm;
	            var isHold		= document.lotCorrectionsForm['lotCorrection.hold'].checked;
                var pa=document.getElementById("message");
	            pa.innerHTML = '';

                if(productSelected(form)==false)
                {
                    return;
                }
                if(locationSelected(form)==false)
                {
                    return;
                }
                if(lotNoSelected(form)==false)
                {
                    return;
                }
                if(form.lotId.value =="-1")
                {
                    if(form['lotCorrection.fabLotNumber'].value=='')
                    {
                        pa.innerHTML = "<li>Enter Fab Lot Number</li>";
                        form['lotCorrection.fabLotNumber'].focus();
                        return;
                    }
                    if( form['lotCorrection.fabLotNumber'].value.indexOf("'") != "-1" )
                    {
                    pa.innerHTML = "<li>Single quotation is not acceptable in Fab Lot Number</li>";
                    form['fabLotDetails.fabLotNumber'].focus();
                    return;
                    }
                    if(form['lotCorrection.vendorLotNumber'].value=='')
                    {
                        pa.innerHTML = "<li>Enter Vendor Lot Number</li>";
                        form['lotCorrection.vendorLotNumber'].focus();
                        return;
                    }
                    if( form['lotCorrection.vendorLotNumber'].value.indexOf("'") != "-1" )
                    {
                        pa.innerHTML = "<li>Single quotation is not acceptable in Vendor Lot Number</li>";
                        form['lotCorrection.vendorLotNumber'].focus();
                        return;
                    }
                }
            	var processType=form.processType.value;
	            if ( processType== 'Fab' || processType=='Fab Option' || processType=='Wafer Store' )
	            {
                     if(form['lotCorrection.waferQtyIn'].value=='')
                    {
                        form['lotCorrection.waferQtyIn'].focus();
                        pa.innerHTML = "<li>Enter Wafer Quantity In</li>";
                        return;
                    }
                    if(isValidInteger(form['lotCorrection.waferQtyIn'] )==false)
                    {
                        return;
                    }
                    if ( parseInt (form['lotCorrection.waferQtyIn'].value) == 0 )
                    {
                        pa.innerHTML = "<li>Zero value is not permitted for Wafer Quantity In, Please enter greater than Zero";
                        form['lotCorrection.waferQtyIn'].focus();
                        return;
                    }
                    if ( chkDate ( form['lotCorrection.dateIn'].value , 'DateIn ', 'Y' ) == false )
                    {
                              pa.innerHTML = errMsg;
                              form['lotCorrection.dateIn'].focus();
                              return;
                    }
                    if ( form['lotCorrection.lotStatus'].value == 'Close' )
                    {
                    if(form['lotCorrection.dateOut'].value!='')
                    {
                        if ( parseInt (form['lotCorrection.waferQtyIn'].value) == 0 )
                        {
                            pa.innerHTML = "<li>Zero value is not permitted for Wafer Quantity In";
                            form['lotCorrection.waferQtyIn'].focus();
                            return;
                        }
                        if ( chkDate ( form['lotCorrection.dateOut'].value , 'DateOut ' , 'Y' ) == false ){
                              pa.innerHTML = errMsg;
                              form['lotCorrection.dateOut'].focus();
                              return;
                        }
                        if(form['lotCorrection.waferQtyOut'].value=='')
                        {
                            pa.innerHTML = "Enter Wafer Quantity Out";
                            return;
                        }
                        if(!validateDateOut(formatDateAsMMDDYYYY(form['lotCorrection.dateIn'].value),formatDateAsMMDDYYYY(form['lotCorrection.dateOut'].value)) )
                        {
                            pa.innerHTML = "Date Out cannot be less than Date In";
                            form['lotCorrection.dateOut'].focus();
                            return;
                        }
                    }

                    if(form['lotCorrection.waferQtyOut'].value!='')
                    {
                        if (!isInteger(form['lotCorrection.waferQtyOut'].value)){
                        pa.innerHTML = "Enter valid Wafer Quantity Out, Wafer Quantity Out must be number";
                        return;
                        }
                        if ( parseInt (form['lotCorrection.waferQtyOut'].value) == 0 )
                        {
                            pa.innerHTML = "<li>Zero value is not permitted for Wafer Quantity Out, Enter greater than Zero";
                            form['fabLotDetails.waferQtyOut'].focus();
                            return;
                        }
                        if ( parseInt(form['lotCorrection.waferQtyOut'].value) > parseInt(form['lotCorrection.waferQtyIn'].value) )
                        {
                            pa.innerHTML = "Wafer Quantity Out can not be greater than Wafer Quantity In";
                            form['lotCorrection.waferQtyOut'].focus();
                            return;
                        }
                        if(form['lotCorrection.dateIn'].value=='')
                        {
                            pa.innerHTML = "Enter Date In";
                            form['lotCorrection.dateIn'].focus();
                            return;
                        }
                    }
                    }
                    if ( processType== 'Fab' || processType=='Fab Option' )
                    {
                        form['lotCorrection.waferIds'].disabled = false;
                        if ( isWaferIdsValid() == false )
                        {
                           return;
                        }
                        form['lotCorrection.waferIds'].disabled = false;
                    }
                }
                else if (processType=='Assembly' || processType=='Die Bank' || processType=='Tape' || processType=='FT' || processType==' FPO')
                {
                    if(isValidInteger(form['lotCorrection.quantityIn'] )==false)
                    {
                        return;
                    }
                    if(form['lotCorrection.quantityIn'].value=='')
                    {
                        form['lotCorrection.quantityIn'].focus();
                        pa.innerHTML = "<li>Enter Quantity In</li>";
                        return;
                    }
                    if ( parseInt (form['lotCorrection.quantityIn'].value) == 0 )
	                {
                        pa.innerHTML = "<li>Zero value is not permitted for Quantity In, Please enter greater than Zero";
                        form['lotCorrection.quantityIn'].focus();
                        return;
	                }
                    if ( chkDate ( form['lotCorrection.dateIn'].value , 'DateIn ' , 'Y' ) == false )
                    {
                        pa.innerHTML = errMsg;
                        form['lotCorrection.dateIn'].focus();
                        return;
                    }
                    if ( form['lotCorrection.lotStatus'].value == 'Close' )
                    {
                    if(isValidInteger(form['lotCorrection.quantityOut'] )==false)
                    {
                        return;
                    }
                    if(form['lotCorrection.quantityIn'].value!='')
                    {
                        if ( parseInt (form['lotCorrection.quantityIn'].value) == 0 )
                        {
                            pa.innerHTML = "<li>Zero value is not permitted for Quantity In";
                            form['lotCorrection.QuantityIn'].focus();
                            return;
                        }
                        if ( chkDate ( form['lotCorrection.dateOut'].value , 'DateOut ' , 'Y' ) == false )
                        {
                            pa.innerHTML = errMsg;
                            form['lotCorrection.dateOut'].focus();
                            return;
                        }
                        if(form['lotCorrection.quantityOut'].value=='')
                        {
                            pa.innerHTML = "Enter Quantity Out";
                            return;
                        }
                        if ( !validateDateOut(formatDateAsMMDDYYYY(form['lotCorrection.dateIn'].value),formatDateAsMMDDYYYY(form['lotCorrection.dateOut'].value)) )
                        {
                            pa.innerHTML = "Date Out cannot be less than Date In";
                            form['assemblyLotDetails.dateIn'].focus();
                            return;
                        }
                    }
                    if(form['lotCorrection.quantityOut'].value!='')
                    {
                        if (!isInteger(form['lotCorrection.quantityOut'].value)){
                        pa.innerHTML = "Enter valid Quantity Out, Quantity Out must be number";
                        return;
                        }
                        if ( parseInt (form['lotCorrection.quantityOut'].value) == 0 )
                        {
                            pa.innerHTML = "<li>Zero value is not permitted for Quantity Out, Enter greater than Zero";
                            form['lotCorrection.QuantityOut'].focus();
                            return;
                        }
                        if ( parseInt(form['lotCorrection.quantityOut'].value) > parseInt(form['lotCorrection.quantityIn'].value) )
                        {
                            pa.innerHTML = "Quantity Out can not be greater than Quantity In";
                            form['lotCorrection.QuantityOut'].focus();
                            return;
                        }
                        if(form['lotCorrection.dateIn'].value==''){
                            pa.innerHTML = "Enter Date In";
                            form['lotCorrection.dateIn'].focus();
                            return;
                        }
                    }
                    }
                }
                 else if (processType=='FG')
                {
                    if(isValidInteger(form['lotCorrection.quantityIn'] )==false)
                    {
                        return;
                    }
                    if(form['lotCorrection.quantityIn'].value=='')
                    {
                        form['lotCorrection.quantityIn'].focus();
                        pa.innerHTML = "<li>Enter Quantity In</li>";
                        return;
                    }
                    if ( parseInt (form['lotCorrection.quantityIn'].value) == 0 )
	                {
                        pa.innerHTML = "<li>Zero value is not permitted for Quantity In, Please enter greater than Zero";
                        form['lotCorrection.quantityIn'].focus();
                        return;
	                }
                    if ( chkDate ( form['lotCorrection.dateIn'].value , 'DateIn ' , 'Y' ) == false )
                    {
                        pa.innerHTML = errMsg;
                        form['lotCorrection.dateIn'].focus();
                        return;
                    }
                    if(form['lotCorrection.dateIn'].value=='')
                    {
                        pa.innerHTML = "Enter Date In";
                        form['lotCorrection.dateIn'].focus();
                        return;
                    }
                }
                if( form['lotCorrection.lotCategory'].value == '' )
                {
                    pa.innerHTML = "<li>Select Lot Category";
                    form['lotCorrection.lotCategory'].focus();
                    return;
                }
                if( form['lotCorrection.lotComments'].value.trim().length > 1000 )
                {
                    pa.innerHTML = "<li>Comments should not be greater than 1000 characters";
                    form['lotCorrection.lotComments'].focus();
                    return;
                }
                form.action.value = "save_lotCorrection";
                form.submit();
            }
            function productSelected(form)
            {
                var pa=document.getElementById("message");
                var x = form.processStepId;

                for(var i=0; i< x.length; i++)
                {
                    if(x.options[i].selected)
                    {
                        if(x.options[i].value == "0")
                        {
                            pa.innerHTML = "<li>Select Product Name</li>";
                            x.focus();
                            return false;
                        }
                    }
                }
                return true;
            }
            function lotNoSelected(form)
            {
                var pa=document.getElementById("message");
                var x = form.lotId;

                for(var i=0; i< x.length; i++)
                {
                    if(x.options[i].selected)
                    {
                        if(x.options[i].value == "0")
                        {
                            pa.innerHTML = "<li>Select Lot Number</li>";
                            x.focus();
                            return false;
                        }
                    }
                }
                return true;
            }
            function isValidInteger(temp)
            {
                var errors = "";
                var pa=document.getElementById("message");

                if(!isInteger(temp.value))
                {
                    errors = "<li>Please enter a valid integer</li>";
                    pa.innerHTML = errors;
                    temp.focus();
                    return false;
                }
                return true;
            }
            function locationSelected(form)
            {
                var pa=document.getElementById("message");
                var x = form.locationId;

                for(var i=0; i< x.length; i++)
                {
                    if(x.options[i].selected)
                    {
                        if(x.options[i].value == "0")
                        {
                            pa.innerHTML = "<li>Select Location</li>";
                            x.focus();
                            return false;
                        }
                    }
                }
                return true;
            }
            function LotCorrectionWafers()
            {
                var pa=document.getElementById("message");
                pa.innerHTML = '';
                var form = document.lotCorrectionsForm;
                var waferQtyInCtrl = form['lotCorrection.waferQtyIn'];
                var waferQty =  form['lotCorrection.waferQtyIn'].value

                if ( form['lotCorrection.waferQtyIn'].value.trim() == '' )
                {
                    pa.innerHTML = "<li>Wafer Quantity In cannot be blank</li>";
                    waferQtyInCtrl.focus();
                    return;
                }
                if ( !isInteger( waferQtyInCtrl.value ) )
                {
                    pa.innerHTML = "<li>Please enter valid Wafer Quantity In, Wafer Quantity In must be number</li>";
                    waferQtyInCtrl.focus();
                    return;
                }
                if ( parseInt ( waferQtyInCtrl.value, 10 ) == 0 )
                {
                    pa.innerHTML = "<li>Zero value is not permitted for Wafer Quantity In, Please enter greater than Zero</li>";
                    waferQtyInCtrl.focus();
                    return;
                }
                if ( parseInt ( waferQtyInCtrl.value, 10 ) > 25 )
                {
                    pa.innerHTML = "<li>Wafer Quantity In cannot be greater than 25</li>";
                    waferQtyInCtrl.focus();
                    return;
                }
                newWindow = window.open ('<%=chipTracContext%>/jsp/operations/lot_correction_wafers.jsp?waferQty='+waferQty,'LotCorrectionWaferPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,width=600,height=375,resizable=yes');
                newWindow.focus();
            }
            function isWaferIdsValid()
            {
                var pa=document.getElementById("message");
                pa.innerHTML = '';
                var form = document.lotCorrectionsForm;
                var waferQtyInCtrl = eval( form['lotCorrection.waferQtyIn']);
                waferQty = waferQtyInCtrl.value;
                var waferIds = form['lotCorrection.waferIds'].value;

                if( waferQty != null )
                {
                     if(waferIds == '')
                     {
                        pa.innerHTML = '<li>Please enter Wafer Ids</li>';
                        return false;
                     }
                }

                if ( waferIds.charAt ( waferIds.length -1 ) != ';' ) //waferIds should end with ';' then only the following validation works
                {
                    waferIds = waferIds + ";"
                }
                var waferIdsArr = waferIds.split(";");
                if ( parseInt ( waferQty, 10 ) > 0 )
                {
                    if ( waferIdsArr != null )
                    {
                        if ( waferIdsArr.length == 1 && waferIdsArr[0] == "" )
                        {
                            pa.innerHTML = '<li>Please enter Wafer Ids</li>';
                            return false;
                        }
                        if ( parseInt ( waferQty, 10 ) != parseInt ( waferIdsArr.length ) - 1 )
                        {
                            pa.innerHTML = '<li>Wafer Ids are not matched with the Wafer Quantity In </li>';
                            form['lotCorrection.waferIds'].disabled = true;
                            return false;
                        }
                    }
                }
                form['lotCorrection.waferIds'].disabled = true;
                return true;
            }
            function checkLength(element, size)
            {
                if(	element.value.length >= size )
                {
                    event.returnValue = false;
                }
            }
        </script>
    </HEAD>
    <BODY bgColor="#ffffff" leftMargin="0" topMargin="0" marginheight="0" marginwidth="0" >
    <!-- Top Header Start-->

        <%@ include file="/jsp/includes/header.jsp" %>

        <!-- Top Header End-->

        <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <!--TBODY-->
        <TR>
            <TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

            <!-- Side Navigation start -->
            <%@ include file="/jsp/operations/dataentryMenu.jsp" %>
            <!-- end of the side navigations -->
            <TD bgcolor="#ffffff"><IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8/></TD>
            <TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2/></TD>
            <TD valign="top" width="100%">
                <IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0/>
                <BR>
                <!-- from here your body starts -->
                <html:form name="lotCorrectionsForm"  type="com.scalar.chiptrack.operations.dataentry.lotcorrection.forms.LotCorrectionForm" action="/lotCorrection">
                <input type="hidden" name="action" value="<%= (String)request.getAttribute("action")%>">

                    <TABLE border="0" width="90%" align=center>
                        <TR><TD colspan=5 class="NArialW" align="center">Lot Correction</TD></TR>
                        <TR><TD colspan=5>&nbsp;</TD></TR>
                        <TR>
                            <TD colspan=5 class='NArialL'>
                                <strong>
                                <FONT id="message" styleClass="NArialL" color='FF0000'>
                                </FONT></strong>
                            </TD>
                        </TR>
                        <TR>
                            <TD colspan=5>&nbsp;
                                <chiptrack:info styleClass="NArialL" />
                                <chiptrack:errors styleClass="NArialL" />
                                <chiptrack:messages type="info" styleClass="NArialL" />
                            </TD>
                        </TR>
                        <logic:equal name="showMessage" value="TRUE">
                        <TR>
                            <TD colspan=5 align='left'>
                                <font class='NArialS' color='blue'><b><%=Constants.NO_MODIFY_RIGHTS %></b></font>
                            </TD>
                        </TR>
                        </logic:equal>
                        <TR><TD colspan=5>&nbsp;</TD></TR>
                        <TR>
                            <TD colspan=5 align = "left" class="NArialL">
                            <logic:equal name = "ListSize" value = "2" >
                                <a  href="javascript:showLotInformation()" onmouseover="window.status='Click to show All Lot info';return true" onmouseout="window.status='';return true">Click here</a> &nbsp;to view Lot History
                            </logic:equal>
                            </TD>
                        </TR>
                        <TR>
                            <TD>
                                <TABLE border="0" width="100%">
                                <TR>
                                    <TD width="20%"><font class="NArialL">Select Process Type:</font></TD>
                                    <TD width="25%">
                                        <p>
                                        <font class="NArialL">
                                        <html:select property="processType"  styleClass="txfield" onchange="javascript:loadProducts();" >
                                            <html:option value="0">Select Process</html:option>
                                            <html:options collection="processList" property="value" labelProperty="label"/>
                                        </html:select>
                                        </font>
                                        </p>
                                    </TD>
                                    <logic:present name="partNumbersList" >
                                    <TD width="20%"><font class="NArialL">Select Product Name:</font></td>
                                    <TD width="20%" align=left>
                                        <font class="NArialL">
	                                    <html:select property="processStepId"  styleClass="txfield" onchange="loadLocations()"  >
	                                        <html:option value="0">Select Part Number</html:option>
                                            <html:options collection="partNumbersList" property="value" labelProperty="label"/>
                                        </html:select>
                                        </font>
                                    </TD>
                                    </logic:present>
                                    <logic:notPresent name="partNumbersList">
                                    <TD width="40%" colspan="2"/>
                                    </logic:notPresent>
                                </TR>
                                <TR>
                                    <logic:present name="locationList" >
                                    <TD width="20%"><font class="NArialL">Select Location:</font></td>
                                    <TD width="25%">
                                        <P><font class="NArialL">
                                        <html:select property="locationId"  styleClass="txfield" onchange="loadLotNumbers()"  >
                                            <html:option value="0">Select Location</html:option>
                                            <html:options collection="locationList" property="value" labelProperty="label"/>
                                        </html:select>
                                        </font>
                                        </P>
                                    </TD>
                                    </logic:present>
                                    <logic:notPresent name="locationList">
                                    <TD width="40%" colspan="2"/>
                                    </logic:notPresent>
                                    <logic:present name="lotNumberList" >
                                    <TD width="20%" class="NArialL" >Select Lot:</td>
                                    <TD width="25%" class="NArialL">
                                        <p>
                                        <html:select property="lotId"  styleClass="txfield" onchange="loadLot()"  >
                                            <html:option value="0">Select Lot</html:option>
                                            <html:options collection="lotNumberList" property="value" labelProperty="label"/>
                                        </html:select>
                                        </p>
                                    </TD>
                                    </logic:present>
                                    <logic:notPresent name="lotNumberList">
                                    <TD width="40%" colspan="2"/>
                                    </logic:notPresent>
                                </TR>

                                <TR><TD colspan=4 width="7%">&nbsp;</TD></TR>
                                <nested:notEqual property="lotId" value="0">
                                <nested:nest property = "lotCorrection">
                                <TR>
                                    <TD width="20%" class="NArialL">Fab Lot Number:<font color="red"><b>*</b></font></TD>
                                    <TD width="20%">
                                        <nested:text property="fabLotNumber" size="25" styleClass="txfield" maxlength="30" />
                                    </TD>
                                    <TD width="20%" class="NArialL"></TD>
                                    <nested:notEqual property="lotStatus" value="Close">
                                    <TD width="20%" class="NArialL">
                                        <nested:checkbox  property="hold" styleClass="txfield"  />&nbsp; Hold
                                    </TD
                                    </nested:notEqual>
                                    <nested:equal property="lotStatus" value="Close">
                                    <TD width="20%" class="NArialL">
                                        <nested:checkbox  property="hold" styleClass="txfield"  disabled="true" />&nbsp; Hold
                                    </TD>
                                    </nested:equal>
                                </TR>
                                <TR>
                                    <TD width="20%" class="NArialL">Vendor Lot Number:</TD>
                                    <TD width="20%">
                                        <nested:text property="vendorLotNumber" size="25" styleClass="txfield" maxlength="50" />
                                    </TD>
                                      <%--  <nested:notEqual property="processType" value="Finished Goods">--%>
                                    <TD width="20%" class="NArialL">Lot Status:</TD>
                                    <TD width="25%" class="NArialL">
                                        <nested:text property="lotStatus" size="16" styleClass="valuetxfield" maxlength="7" disabled="true"/>
                                    </TD>
                                  <%--    </nested:notEqual>  --%>
                                </TR>
                                <nested:hidden name = "ptype" property="processType" />

                                <TR>
                                <nested:equal property="processType" value="Fab">
                                    <TD width="25%" class="NArialL">Wafer Qty In: <font color="red"><b>*</b></font> </td>
                                    <TD width="25%" class="NArialL">
                                        <nested:text  property="waferQtyIn" size="16" styleClass="valuetxfield" maxlength="7"  onkeypress="javascript:restrictCharacters(this,6,2)"/>
                                    </TD>
                                </nested:equal>

                                <nested:equal property="processType" value="Wafer Store">
                                    <TD width="25%" class="NArialL">Wafer Qty In: <font color="red"><b>*</b></font> </td>
                                    <TD width="25%" class="NArialL">
                                        <nested:text  property="waferQtyIn" size="16" styleClass="valuetxfield" maxlength="7"  onkeypress="javascript:restrictCharacters(this,6,2)"/>
                                    </TD>
                                </nested:equal>
                                <nested:equal property="processType" value="Fab Option">
                                    <TD width="25%" class="NArialL">Wafer Qty In: <font color="red"><b>*</b></font> </td>
                                    <TD width="25%" class="NArialL">
                                        < nested:text  property="waferQtyIn" size="16" styleClass="valuetxfield" maxlength="7"  onkeypress="javascript:restrictCharacters(this,6,2)"/>
                                    </TD>
                                </nested:equal>
                                <nested:equal property="processType" value="FPO">
                                    <TD width="20%" class="NArialL">Quantity In:<font color="red"><b>*</b></font></td>
                                    <TD width="20%">
                                        <nested:text property="quantityIn" size="16" styleClass="valuetxfield" maxlength="7" />
                                    </TD>
                                </nested:equal>
                                <nested:equal property="processType" value="FT">
                                    <TD width="20%" class="NArialL">Quantity In:<font color="red"><b>*</b></font></td>
                                    <TD width="20%">
                                        <nested:text property="quantityIn" size="16" styleClass="valuetxfield" maxlength="7" />
                                    </TD>
                                </nested:equal>
                                <nested:equal property="processType" value="Tape">
                                    <TD width="20%" class="NArialL">Quantity In:<font color="red"><b>*</b></font></td>
                                    <TD width="20%">
                                        <nested:text property="quantityIn" size="16" styleClass="valuetxfield" maxlength="7" />
                                    </TD>
                                </nested:equal>
                                <nested:equal property="processType" value="Assembly">
                                    <TD width="20%" class="NArialL">Quantity In:<font color="red"><b>*</b></font></td>
                                    <TD width="20%">
                                        <nested:text property="quantityIn" size="16" styleClass="valuetxfield" maxlength="7" />
                                    </TD>
                                </nested:equal>
                                <nested:equal property="processType" value="Die Bank">
                                    <TD width="20%" class="NArialL">Quantity In:<font color="red"><b>*</b></font></td>
                                    <TD width="20%">
                                        <nested:text property="quantityIn" size="16" styleClass="valuetxfield" maxlength="7" />
                                    </TD>
                                </nested:equal>
                                <nested:equal property="processType" value="FG">
                                   <TD width="20%" class="NArialL">Quantity In:<font color="red"><b>*</b></font></td>
                                    <TD width="20%">
                                        <nested:text property="quantityIn" size="16" styleClass="valuetxfield" maxlength="7" />
                                    </TD>
                                </nested:equal>
                                    <TD width="20%" class="NArialL">Date In: <font color="red"><b>*</b></font></td>
                                    <TD width="20%">
                                        <nested:text property="dateIn" size="16" maxlength="10" styleClass="txfield" />
                                        <a href="javascript:openCalendar(document.lotCorrectionsForm['lotCorrection.dateIn'] )">
                                        <img onMouseOver="window.status='Click here to select date';return true"  onMouseOut="window.status='';return true" border="0" align='center'
                                        src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20></a>
                                    </TD>
                                </TR>
                                <nested:equal property="lotStatus" value="Close">
                                <TR>
                                    <nested:equal property="processType" value="Fab">
                                    <TD width="20%" class="NArialL">Wafer Qty Out:<font color="red"><b>*</b></font></td>
		                            <TD width="25%">
		                                <nested:text property="waferQtyOut" size="16" styleClass="valuetxfield" maxlength="7" />
                                    </TD>
                                    </nested:equal>
                                    <nested:equal property="processType" value="Wafer Store">
                                    <TD width="20%" class="NArialL">Wafer Qty Out:<font color="red"><b>*</b></font></td>
		                            <TD width="25%">
		                                <nested:text property="waferQtyOut" size="16" styleClass="valuetxfield" maxlength="7" />
                                    </TD>
                                </nested:equal>
                                <nested:equal property="processType" value="Fab Option">
	                              <TD width="20%" class="NArialL">Wafer Qty Out:<font color="red"><b>*</b></font></td>
		                            <TD width="25%">
		                                <nested:text property="waferQtyOut" size="16" styleClass="valuetxfield" maxlength="7" />
                                    </TD>
                                </nested:equal>
                                <nested:equal property="processType" value="FPO">
	                                <TD width="20%" class="NArialL">Quanity Out:<font color="red"><b>*</b></font></td>
		                            <TD width="25%">
		                                <nested:text property="quantityOut" size="16" styleClass="valuetxfield" maxlength="7" />
                                    </TD>
                               </nested:equal>
                                <nested:equal property="processType" value="FT">
	                                <TD width="20%" class="NArialL">Quanity Out:<font color="red"><b>*</b></font></td>
		                            <TD width="25%">
		                                <nested:text property="quantityOut" size="16" styleClass="valuetxfield" maxlength="7" />
                                    </TD>
                               </nested:equal>
                                <nested:equal property="processType" value="Tape">
	                               <TD width="20%" class="NArialL">Quanity Out:<font color="red"><b>*</b></font></td>
		                            <TD width="25%">
		                                <nested:text property="quantityOut" size="16" styleClass="valuetxfield" maxlength="7" />
                                    </TD>
                                </nested:equal>
                                <nested:equal property="processType" value="Die Bank">
	                                <TD width="20%" class="NArialL">Quanity Out:<font color="red"><b>*</b></font></td>
		                            <TD width="25%">
		                                <nested:text property="quantityOut" size="16" styleClass="valuetxfield" maxlength="7" />
                                    </TD>
                                </nested:equal>
                                <nested:equal property="processType" value="Assembly">
                                <TR>
                                    <TD width="20%" class="NArialL">Quanity Out:<font color="red"><b>*</b></font></td>
                                    <TD width="25%">
                                        <nested:text property="quantityOut" size="16" styleClass="valuetxfield" maxlength="7" />
                                    </TD>
                                </nested:equal>
                                <nested:equal property="processType" value="FG">
                                <TR>
                                    <TD width="20%" class="NArialL">&nbsp;</td>
                                    <TD width="25%">&nbsp;</TD>
                                </nested:equal>
                                    <TD width="20%" class="NArialL">Date Out:<font color="red"><b>*</b></font></td>
		                            <TD width="25%" class="NArialL">
		                                <nested:text property="dateOut" size="16" maxlength="10" styleClass="txfield" />
		                                <a href="javascript:openCalendar(document.lotCorrectionsForm['lotCorrection.dateOut'])">
		                                <img onMouseOver="window.status='Click here to select date';return true"  onMouseOut="window.status='';return true" border="0" align='center'
		                                    src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20></a>
		                            </TD>
	                            </TR>

                                </nested:equal>
                                <TR>
                                    <TD width="20%" class="NArialL">DateCode:</TD>
                                    <TD width="25%">
                                        <nested:text property="dateCode" size="16" styleClass="valuetxfield" maxlength="50" />
                                    </TD>
                                    <TD width="20%"><font class="NArialL">Lot Category:<font color="red"><b>*</b></font></font></TD>
                                    <TD width="25%" class="NArialL"><nested:select property="lotCategory" styleClass="txfield" >
                                        <html:option value="">Select Lot Category</html:option>
                                        <html:options collection="lotCategoryList" property="value" labelProperty="label"/>
                                        </nested:select>
                                    </TD>
                                </TR>
                                <nested:equal property="processType" value="Fab">
                                <TR>
                                    <TD width="20%"></TD>
                                    <TD width="25%"></TD>
                                    <TD width="20%"><font class="NArialL">
                                        <a href="javascript:LotCorrectionWafers();" onMouseOver="window.status='Click here to Enter Wafer Data Entry';return true" onMouseOut="window.status='';return true">
                                        Wafer Ids</a><font color="red"><b>*</b></font></font></TD>
                                    <TD width="25%" class="NArialL"><nested:text property="waferIds" disabled="true" styleClass="txfield"/></TD>
                                </TR>
                                </nested:equal>
                                <nested:equal property="processType" value="Fab Option">
                                <TR>
                                    <TD width="20%"></TD>
                                    <TD width="25%"><font class="NArialL">
                                        <a href="javascript:LotCorrectionWafers();" onMouseOver="window.status='Click here to Enter Wafer Data Entry';return true" onMouseOut="window.status='';return true">
                                        Wafer Data Entry</a><font color="red"><b>*</b></font></font></TD>
                                    <TD width="20%"><font class="NArialL">Wafer Ids:</font></TD>
                                    <TD width="25%" class="NArialL"><nested:text property="waferIds" disabled="true" styleClass="txfield"/></TD>
                                </TR>
                                </nested:equal>
                                <TR>
                                    <TD class='NArialL'>Comments : </TD>
                                    <TD colspan = 3>
                                        <nested:textarea property="lotComments" styleClass="txfield" rows="4" cols="80" onkeypress="javascript:checkLength(this, 1000)" />
                                    </TD>
                                </TR>
                                <TR><TD colspan=4 width="7%">&nbsp;</TD></TR>
                                <TR>
                                    <TD align=center colspan=4>
                                        <chiptrack:restrictedLink functionality='<%=Functionality.LOT_CORRECTION%>' action='<%=User.USER_ACTION_MODIFY%>' href='javascript:save();' onmouseover="window.status='Click to Save Lot Data';return true" onmouseout="window.status='';return true">
                                            <img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" title='Click here to Save Lot Data'/>
                                        </chiptrack:restrictedLink>
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        <a href="<%=chipTracContext%>/lotCorrection.do?action=processTypes"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" width="53" height="17" onmouseover="window.status='Click to Cancel Changes';return true" onmouseout="window.status='';return true" title="Click here to Cancel Changes"></a>
                                    </TD>
                                </TR>
                                </nested:nest>
                                </nested:notEqual>
                                <nested:equal property="lotId" value="0">
                                <TR><TD colspan=4 width="7%">&nbsp;</TD></TR>
                                </nested:equal>
                            </TABLE>
                        </TD>
                    </TR>
                    <TR>
                        <TD></TD>
                    </TR>
                </TABLE>
            </html:form>
            <BR><BR><BR>
            </TD>
            <TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
        </TR>
    </TABLE>
<!-- Footer starts here -->
    <%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->
</BODY>
</HTML>
